export interface IConfig {
	/**启动端口 */
	port: number
	/**数据库配置 */
	database: {
		host: string
		port: number
		username: string
		password: string
		database: string
	},
	/**jwt配置 */
	jwt: {
		secret: string
		expiresIn: string
	}
}

export const env = 'dev'// or pord

export const devConfig:IConfig = {
	port: 3001,
	database: {
		host: 'localhost',
		port: 27017,
		username: 'root',
		password: '!Aa505326722',
		database: 'test'
	},
	jwt: {
		secret: 'xiaobaozi',
		expiresIn: '7d'
	}
}
export const prodConfig:IConfig = {
	port: 3001,
	database: {
		host: 'localhost',
		port: 27017,
		username: 'root',
		password: '!Aa505326722',
		database: 'test'
	},
	jwt: {
		secret: 'xiaobaozi',
		expiresIn: '7d'
	}
}

export default () => (env === 'dev' ? devConfig : prodConfig);
